package com.taotao.web.vo;

public class CommonResult {
	
	private Integer status; //200成功，否则失败
	
	private String msg; //失败后提示消息
	
	private Object data; //可能要携带的数据

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getMsg() {
		return msg;
	}

	public CommonResult(Integer status, String msg) {
		super();
		this.status = status;
		this.msg = msg;
	}

	public CommonResult(Integer status, String msg, Object data) {
		super();
		this.status = status;
		this.msg = msg;
		this.data = data;
	}

	public CommonResult() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	public static CommonResult ok(){ // 
		return new CommonResult(200, null);
	}
	
	public static CommonResult ok(Object data){
		return new CommonResult(200, null, data);
	}
	
	public static CommonResult build(Integer status, String msg){
		return new CommonResult(status, msg);
	}
	
	public static CommonResult build(Integer status, String msg, Object data){
		return new CommonResult(status, msg, data);
	}


	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	
}
